package model

import (
	"gorm.io/gorm"
	"time"
)

// 商铺表
type Shop struct {
	Id              uint32         `gorm:"column:id;type:int UNSIGNED;comment:商铺id;primaryKey;not null;" json:"id"`                   // 商铺id
	BrandId         uint32         `gorm:"column:brand_id;type:int UNSIGNED;comment:代理品牌id;not null;default:0;" json:"brand_id"`      // 代理品牌id
	ShopName        string         `gorm:"column:shop_name;type:varchar(50);comment:商铺名称;not null;" json:"shop_name"`                 // 商铺名称
	ShopImage       string         `gorm:"column:shop_image;type:varchar(500);comment:商铺图片;not null;" json:"shop_image"`              // 商铺图片
	ShopAddress     string         `gorm:"column:shop_address;type:varchar(200);comment:商铺地址;not null;" json:"shop_address"`          // 商铺地址
	ShopDescription string         `gorm:"column:shop_description;type:varchar(500);comment:商铺介绍;not null;" json:"shop_description"`  // 商铺介绍
	ShopPhone       string         `gorm:"column:shop_phone;type:char(11);comment:商铺电话;not null;" json:"shop_phone"`                  // 商铺电话
	ShopEmail       string         `gorm:"column:shop_email;type:varchar(50);comment:商铺邮箱;not null;" json:"shop_email"`               // 商铺邮箱
	MonthSales      uint32         `gorm:"column:month_sales;type:int UNSIGNED;comment:月销量;not null;default:0;" json:"month_sales"`   // 月销量
	Status          uint32         `gorm:"column:status;type:int UNSIGNED;comment:商铺状态：1正常营业 2已关闭;not null;default:1;" json:"status"` // 商铺状态：1正常营业 2已关闭
	CreatedAt       time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt       time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt       gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (s *Shop) TableName() string {
	return "shop"
}
